<template>
  <button @click="increment">
    count={{count}}
  </button>
</template>

<script lang="ts" setup>
    import { onMounted, ref } from 'vue';
    
    let count=ref(0);

    function increment(){
      count.value++;
    }

    onMounted(() => {
      console.log(`count的初始值是：${count.value}`)
    })
</script>


<!-- <script lang="ts">
import { onMounted, ref } from 'vue';
export default {
  setup(){
    let count=ref(0);

    function increment(){
      count.value++;
    }

    onMounted(() => {
      console.log(`count的初始值是：${count.value}`)
    })

    return {count,increment}
  }
}
</script> -->

<style>
button{
  font-size:30px;
}
</style>
